#pragma once
#include "../include/SpritesManager.hpp"

// Human
#include "../build/HUMAN_1.h"
#include "../build/HUMAN_2.h"
#include "../build/HUMAN_3.h"
// Vampire
#include "../build/VAMPIRE_1.h"
#include "../build/VAMPIRE_2.h"
#include "../build/VAMPIRE_3.h"
// Zombie
#include "../build/ZOMBIE_1.h"
#include "../build/ZOMBIE_2.h"
#include "../build/ZOMBIE_3.h"

#include "../include/enum.h"

/*! \class Sprite
	This class handle the loading of a Sprite according to the number of space left in the OAM
*/

class Sprite
{
public:
	unsigned int OAM_ID;
	int x; 
	int y;
	bool displayed;
	Screen screen;

	Sprite(void);
	virtual ~Sprite(void);

	/*!	\fn !!!!OBSOLETE !!!!loadAndDisplay(SpritesManager* spritesManager, unsigned int x, unsigned int y,  const unsigned int * tiles, int tilesLen, const unsigned short* pal, int palLen)
		\param spritesManager : a pointer toward the manager which should handle the sprite
		\param x : sprite position in x
		\param y : sprite position in y
		\param tiles : pointer to the array containing the gfx data. Provided by [MY_GFX].h Usualy is MY_GXBitmap
		\param tilesLen : tiles array lenght. Provided by grit in [MY_GFX].h
		\param pal : pointer to the pallete array. 
		\param palLen : palette length. MUST BE 32 for standard sprites. /!\ WARNING /!\ The value provided by grit is FALSE. Force this param to 32
	*/
	void loadAndDisplay(SpritesManager* spritesManager, Screen pos, unsigned int x, unsigned int y, ObjPriority priority, const unsigned int * tiles, int tilesLen, const unsigned short* pal, int palLen);
	
	/*!	\fn display(SpritesManager* spritesManager, Screen pos, unsigned int x, unsigned int y,  unsigned int tilesId, unsigned int palId)
		
		\param spritesManager : a pointer toward the manager which should handle the sprite
		\param pos : BOTTOM or TOP : the screen on which the sprite will be displayed
		\param x : sprite position in x
		\param y : sprite position in y
		\param priority : Sprite priority for dispay. Must be OBJPRIORITY_0 (Hud), OBJPRIORITY_1 (Hero), OBJPRIORITY_2 (Ennemy), OBJPRIORITY_3 (decorElement)
		\param tilesId : Reference to the tiles data loaded in memory (see SpriteManager::loadTilesIntoRam())
		\param palId : Reference to the palette data loaded in memory (see SpriteManager::loadPalIntoram())	
	*/
	void display(SpritesManager* spritesManager, Screen pos, unsigned int x, unsigned int y,  ObjPriority priority, unsigned int tilesId, unsigned int palId, SpriteType spriteType);

	void freeSprite (SpritesManager* spritesManager, SpriteType spriteType);
};

